/**
 * 
 */
package com.youxin.cpcenter.pt.service.member;

import com.youxin.busfoundation.bean.ent.RequestMemberInfo;
import com.youxin.busfoundation.bean.ent.ResponseAccountsBean;
import com.youxin.busfoundation.common.es.bean.CompanyInfoBean;
import com.youxin.busfoundation.net.WebVisitor;
import com.youxin.cpcenter.pt.bean.ResponseLogin;
import com.youxin.cpcenter.pt.bean.ResponseOutMessage;
import com.youxin.cpcenter.pt.common.PtConfig;
import com.youxin.cpcenter.pt.service.BaseOperation;
import com.youxin.cpcenter.pt.service.PtTask;
import com.youxin.foundation.utils.JsonUtils;

/**
 * @author yingde.cao
 * @date 2017年12月24日
 * @version 1.0
 */
public class AddMember extends BaseOperation{
	public static ResponseOutMessage postMethod(RequestMemberInfo bean,CompanyInfoBean companyInfoBean)
	{
		
		String url = PtConfig.currentURL() + PtConfig.ADD_MEMBER_SUFIX;// "/api/ent/addmember";
		String outJson = WebVisitor.instance().httpPostJsonBody(url, bean,PtTask.instanse().getTokenMap(companyInfoBean));
		ResponseOutMessage outBean = JsonUtils.stringToFasterxmlObject(outJson, ResponseOutMessage.class);		
		
		long time=outBean.getResponseTime()-bean.getRequestTime();
		saveRequestTimeToRedis(PtConfig.ADD_MEMBER_SUFIX, time);
		
		return outBean;
	}
}
